package com.gxm.练习.多线程.线程池;

import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @创建人 郭训民
 * @创建时间 2019/11/23
 * @描述
 */
public class 自定义 {
    public static void main(String[] args) {
        Executor executor = new ThreadPoolExecutor(1,0, 0l, TimeUnit.SECONDS, new LinkedBlockingQueue(1));
        //Executor executor = Executors.newFixedThreadPool(0);
        Thread t1 = new Thread(()->{
            System.out.println("线程1被执行");
        });
        executor.execute(t1);
        //t1.start();
    }
}
